﻿using System.Windows.Media.Imaging;
using PicturePortfolio.ServiceReference;
using Caliburn.Micro;
namespace PicturePortfolio.Silverlight.ViewModels
{
    public class IndividualThumbnailViewModel:PropertyChangedBase
    {
        public IndividualThumbnailViewModel(Photo photo)
        {
            this.PhotoName = photo.Name;
            this.ImageSource = HelperMethods.ConvertByteArrayToBitMapImage(photo.ImageThumbNail);
            this.Photo = photo;
        }

        public Photo Photo
        {
            get;
            private set;
        }
        string _photoName;
        public string PhotoName
        {
            get { return _photoName; }
            private set
            {
                _photoName = value;
                NotifyOfPropertyChange(() => PhotoName);
            }
        }

        BitmapImage _imageSource;
        public BitmapImage ImageSource
        {
            get { return _imageSource; }
            private set
            {
                _imageSource = value;
                NotifyOfPropertyChange(() => ImageSource);
            }
        }
    }
}
